<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Store" %>
<%@ page import="com.fc.control.StoreControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>store_add_do</title>
</head>
<body>
<%
      request.setCharacterEncoding("UTF-8");
      String store_name = ParamUtil.getString(request,"store_name");   
      String place = ParamUtil.getString(request,"place");
  	  int boss_id =  ParamUtil.getInt(request,"boss_id");
  	  //int workers =  ParamUtil.getInt(request,"members");
  	  //int members =  ParamUtil.getInt(request,"workers");
  	  //int coaches =  ParamUtil.getInt(request,"coaches");
  	  //int items =  ParamUtil.getInt(request,"items");
  	  int price0 =  ParamUtil.getInt(request,"price0");
  	  int price1 =  ParamUtil.getInt(request,"price1");
  	  int price2 =  ParamUtil.getInt(request,"price2");
  	  
  	  StoreControl sc = new StoreControl();
      Store store = new Store();
      store.setStore_name(store_name);
	  store.setPlace(place);
	  store.setBoss_id(boss_id);
	  //store.setMembers(members);
	  //store.setWorkers(workers);
	  //store.setCoaches(coaches);
	  //store.setItem_num(items);
	  store.setPrice0(price0);
	  store.setPrice1(price1);
	  store.setPrice2(price2);
        if(sc.addStore(store))
  			{
  				%>
		<script language="javascript">
				if(window.confirm("添加成功，是否继续?"))
				window.location.href="store_add.jsp";
				else
  				window.location.href="store.jsp";
  				</script>
		<%} else { %>
		<script language="javascript">
  				if(window.confirm("添加失败，是否重新添加?"))
				window.location.href="store_add.jsp";
				else
				window.location.href="store.jsp";
  		</script>
		<%} 
   %>
</body>
</html>